﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Compass.WmsService.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class changeinventory : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Description",
                table: "StockOuts");

            migrationBuilder.DropColumn(
                name: "MtlNumber",
                table: "StockOuts");

            migrationBuilder.DropColumn(
                name: "Description",
                table: "StockIns");

            migrationBuilder.DropColumn(
                name: "MtlNumber",
                table: "StockIns");

            migrationBuilder.DropColumn(
                name: "Unit",
                table: "StockIns");

            migrationBuilder.DropColumn(
                name: "Description",
                table: "Inventories");

            migrationBuilder.DropColumn(
                name: "MtlNumber",
                table: "Inventories");

            migrationBuilder.DropColumn(
                name: "Unit",
                table: "Inventories");

            migrationBuilder.RenameColumn(
                name: "Unit",
                table: "StockOuts",
                newName: "Station");

            migrationBuilder.RenameColumn(
                name: "ReceiptTime",
                table: "StockIns",
                newName: "InTime");

            migrationBuilder.AlterColumn<DateTime>(
                name: "OutTime",
                table: "StockOuts",
                type: "datetime2",
                nullable: true,
                oldClrType: typeof(DateTime),
                oldType: "datetime2");

            migrationBuilder.AddColumn<DateTime>(
                name: "ExpectedTime",
                table: "StockOuts",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<Guid>(
                name: "OperatorId",
                table: "Inventories",
                type: "uniqueidentifier",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "ExpectedTime",
                table: "StockOuts");

            migrationBuilder.DropColumn(
                name: "OperatorId",
                table: "Inventories");

            migrationBuilder.RenameColumn(
                name: "Station",
                table: "StockOuts",
                newName: "Unit");

            migrationBuilder.RenameColumn(
                name: "InTime",
                table: "StockIns",
                newName: "ReceiptTime");

            migrationBuilder.AlterColumn<DateTime>(
                name: "OutTime",
                table: "StockOuts",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                oldClrType: typeof(DateTime),
                oldType: "datetime2",
                oldNullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Description",
                table: "StockOuts",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MtlNumber",
                table: "StockOuts",
                type: "nvarchar(max)",
                nullable: false,
                defaultValue: "");

            migrationBuilder.AddColumn<string>(
                name: "Description",
                table: "StockIns",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MtlNumber",
                table: "StockIns",
                type: "nvarchar(max)",
                nullable: false,
                defaultValue: "");

            migrationBuilder.AddColumn<int>(
                name: "Unit",
                table: "StockIns",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<string>(
                name: "Description",
                table: "Inventories",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MtlNumber",
                table: "Inventories",
                type: "nvarchar(max)",
                nullable: false,
                defaultValue: "");

            migrationBuilder.AddColumn<int>(
                name: "Unit",
                table: "Inventories",
                type: "int",
                nullable: false,
                defaultValue: 0);
        }
    }
}
